﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Citi.GDWAutomation.Domain
{
    public partial class ExpenseCode
    {
    }

    public class ExpenseCodeComparer : IEqualityComparer<ExpenseCode>
    {
        public bool Equals(ExpenseCode x, ExpenseCode y)
        {
            if (Object.ReferenceEquals(x, y)) return true;
            if (Object.ReferenceEquals(x, null) || Object.ReferenceEquals(y, null))
                return false;

            return x.Description == y.Description && x.Id == y.Id;
        }

        public int GetHashCode(ExpenseCode item)
        {
            if (Object.ReferenceEquals(item, null)) return 0;

            int hashDescription = item.Description == null ? 0 : item.Description.GetHashCode();
            int hashId = item.Description == null ? 0 : item.Id.GetHashCode();

            return hashDescription ^ hashId;
        }
    }
}
